const scrollInterval = setInterval(function() {
  $('.editor-wrapper').scrollTop(10000);
}, 100);

new Typed('.editor', {
  strings: content,
  typeSpeed: 170,
  backSpeed: 50,
  onComplete: function() {
    $('.pointer').animate({
      left: $('.send-btn').offset().left,
      top: $('.send-btn').offset().top,
    }, 1000, function() {
      $('.send-btn').click();
      new Typed('.send-to-who', {
        strings: ["", "我最亲爱的^1000毛晓鋆"],
        typeSpeed: 200,
        bindInputFocusEvents: true,
        onComplete: function() {
          $('.pointer').animate({
            left: $('.send-confirm').offset().left,
            top: $('.send-confirm').offset().top,
          }, 500, function() {
            $('.send-confirm').click();
            $('.editor').before('<div class="alert alert-success">成功发送！等待亲爱的毛晓鋆签收……</div>')
            clearInterval(scrollInterval);
            $('.editor-wrapper').scrollTop(0);
            $('.mask').remove();
            $('.pointer').remove();
          });
        }
      });
    });
  }
});